d = {
    "龙江新城市": ["白云园", "腾飞园"],
    "阳光广场": ["龙江小区", "芳草园"],
    "汉江路": ["金信花园", "龙凤花园"],
    "嫩江路": ["西城蓝湾", "花开四季"]
}

def find_key_by_alias(addresses, alias):
    if alias in d:
        return alias
    else:
        # 通过别名查找对应的键
        for key, values in addresses.items():
            if alias in values:
                return key
            
# 输入
alias1 = input()
alias2 = input()

# 通过别名找到对应的键
key1 = find_key_by_alias(d, alias1)
key2 = find_key_by_alias(d, alias2)
# 如果两个别名都找到了对应的键
if key1 and key2:
    # 获取两个键的索引列表
    indices1 = list(d.keys()).index(key1)
    indices2 = list(d.keys()).index(key2)
    # 计算索引差值
    difference = indices2 - indices1
else:
    # 如果任一别名没有找到对应的键，返回错误信息
    difference = 0xFFFF
if difference == 0xFFFF:
    print("Error")
elif difference >= 0:
    print(f"起点站{key1}终点站{key2}共{difference}站")
else:
    print("您需要乘坐反方向线路")
